﻿using System.Collections.Generic;
#if UNITY_EDITOR
#endif
using UnityEngine;

namespace WorldMap
{
    /// <summary>
    /// 地图数据
    /// </summary>
    public class MapData : ScriptableObject
    {
        public int XNum;
        public int YNum;
        public int TileWidth;
        public int TileHeight;
        public List<string> tiles;

        public ulong resTags = ulong.MinValue;

        public MapData()
        {
            tiles = new List<string>();
        }

#if UNITY_EDITOR
        public void ComputeResTags(TileSetData tileSetData)
        {
            // Dictionary<int, ResourceLODConfigData>
            //     m_dicResourceLODConfig = new Dictionary<int, ResourceLODConfigData>();
            // //LOD0资源的索引跟id的对应关系，因为tile里保存的是LOD0的资源
            // Dictionary<string, int> m_dicLOD0ResToID = new Dictionary<string, int>();
            // TextAsset data =
            //     AssetDatabase.LoadAssetAtPath<TextAsset>("Assets/ResourcesAssets/World/mapdata/ResourceLODConfig.txt");
            // if (data != null)
            // {
            //
            //     StringReader reader = new StringReader(data.text);
            //     string strContent = string.Empty;
            //     while (!string.IsNullOrEmpty(strContent = reader.ReadLine()))
            //     {
            //         ResourceLODConfigData config = new ResourceLODConfigData();
            //         string[] singleConfig = strContent.Split('\t');
            //         int id = Convert.ToInt32(singleConfig[0]);
            //         config.id = id;
            //         config.resLOD0 = singleConfig[1];
            //         config.resLOD1 = singleConfig[2];
            //         config.resLOD2 = singleConfig[3];
            //         config.resLOD3 = singleConfig[4];
            //         config.resLOD4 = singleConfig[5];
            //         config.resLOD5 = singleConfig[6];
            //         m_dicResourceLODConfig.Add(config.id, config);
            //         m_dicLOD0ResToID.Add(config.resLOD0, config.id);
            //     }
            // }
        }
        
#endif

    }
}
